﻿using DLog.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DLog.Access
{
    public interface IDal
    {
        /// <summary>
        /// Model information through the log number query log
        /// </summary>
        /// <param name="LogId">log number</param>
        /// <returns></returns>
        LogModel SelectModel(string logId);

        /// <summary>
        /// Available through the log level you fall into this level of logging data set, returns the number
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> SelectList();

        /// <summary>
        /// Available through the log level you fall into this level of logging data set, returns the number
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> SelectList(int logLevel);

        /// <summary>
        /// Through the log level is therefore belongs to the level of a page of log data set, returns the number
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> SelectList(int pageIndex, int pageSize, out int totalCount);

        /// <summary>
        /// Through the log level is therefore belongs to the level of a page of log data set, returns the number
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> SelectList(int logLevel, int pageIndex, int pageSize, out int totalCount);

        /// <summary>
        /// By creating a time interval, so belongs to the rank of a page of log data set, returns the number
        /// </summary>
        /// <param name="CreateStartDate"></param>
        /// <param name="CreateEndDate"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> SelectList(DateTime createStartDate, DateTime createEndDate, int pageIndex, int pageSize, out int totalCount);

        /// <summary>
        /// By creating a log level and the time interval is so belongs to the level of a page of log data set, returns the number
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="CreateStartDate"></param>
        /// <param name="CreateEndDate"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> SelectList(int logLevel, DateTime createStartDate, DateTime createEndDate, int pageIndex, int pageSize, out int totalCount);
        
        /// <summary>
        /// insert log information
        /// </summary>
        /// <param name="lm"></param>
        /// <returns></returns>
        int Insert(LogModel lm);

        /// <summary>
        /// ete the log by log number
        /// </summary>
        /// <param name="LogId"></param>
        /// <returns></returns>
        int Delete(string logId);

        /// <summary>
        /// delete log information
        /// </summary>
        /// <param name="lm"></param>
        /// <returns></returns>
        int Delete(LogModel lm);
    }
}
